@extends('admin.layouts')

@section('content')
<div class="box box-warning">
    <div class="box-body">
        <div class="row">
        @foreach ($photos as $photo)
        
<!--            <img src="{{ Asset('assets/img/work/thumbs/') }}/{{$photo->img}}" alt="..." style="width: 200px; height: 150px; margin: 10px;" class="img-thumbnail">
            <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>-->
        <div class="col-md-2">
            <!-- Primary box -->
            <div class="box box-solid <?php if (1 == $photo->delif) echo "box-primary"; else echo "box-danger";  ?>">
                <div class="box-header">
                    <div class="box-tools pull-right">
                        @if (1 == $photo->delif)
                            <button class="btn btn-primary btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
                            <button class="btn btn-primary btn-sm" data-widget="remove" onclick="return ondelete('{{$photo->id}}');"><i class="fa fa-times" ></i></button>
                        @else 
                            <button class="btn btn-danger btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
                            <button class="btn btn-danger btn-sm" data-widget="remove" onclick="return ondelete('{{$photo->id}}');"><i class="fa fa-times" ></i></button>
                        @endif    
                    </div>
                </div>
                <div class="box-body center" >
                    <img src="{{ Asset('assets/img/work/thumbs/') }}/{{$photo->img}}" alt="..." style="width: 210px; height: 150px;" class="img-thumbnail">
                </div><!-- /.box-body -->
            </div><!-- /.box -->
        </div><!-- /.col -->
        
            
        @endforeach
        </div>
    </div>
</div>

<script>
    function ondelete(id) {
        $.ajax({url:'destroy/'+id});
    }
    $().ready(function() {
        
    });
</script>

@stop